package com.sn.system.common.utils;

public class CheckUtils {
	/**
	  * 
	  */
	 public static boolean isInteger(String value) {
	  try {
		  if(value==null){
			   return false;
		   }	
	   Integer.parseInt(value);
	   return true;
	  } catch (NumberFormatException e) {
	   return false;
	  }
	 }

	 /**
	  * 
	  */
	 public static boolean isDouble(String value) {
	  try {
	   if(value==null){
		   return false;
	   }	  
	   Double.parseDouble(value);
	   if (value.contains("."))
	    return true;
	   return false;
	  } catch (NumberFormatException e) {
	   return false;
	  }
	 }

	 /**
	  * 
	  */
	 public static boolean isNumber(String value) {
	  return isInteger(value) || isDouble(value);
	 }
}
